<template>
  <div class="Manage">
    <Header :zIndex="3" ref="Header"></Header>
    <div class="content-wrap">
        <center>
            <div class="top">
                <ul class="daohang_list">
                    <li><router-link class="list_item" :to="{ path: '/Create' }">创建活动</router-link></li>
                    <li><router-link class="list_item" :to="{ path: '/Manage' }">投票管理</router-link></li>
                    <li><router-link class="list_item on" :to="{ path: '/Level' }">账户升级</router-link></li>
                    <li><router-link class="list_item" :to="{ path: '/Userinfo' }">个人中心</router-link></li>
                    <li><router-link class="list_item" :to="{ path: '/Invate' }">推荐有奖</router-link></li>
                </ul>
            </div>
            <p class="current-member">
                当前套餐
                <span :class="levelIcon" style="font-size:14px;margin:0 5px"><i class="fa fa-diamond"></i></span>
                <span class="blue">{{levelName[userInfo.level]}}</span>
                <span v-if="userInfo.level>0">
                到期时间：<span class="blue">{{formatDate(userInfo.vipEnd)}}</span>
                </span>
                <router-link to="/Pay" class="buy-vip"><i class="fa fa-jpy"></i>续费会员</router-link>
            </p>
            <div id="package_data" class="setmeal-main" style="padding: 10px 0">
                <div class="warp">
                    <ServiceTable></ServiceTable>
                </div>
            </div>
        </center>
    </div>
    <Footer></Footer>
  </div>
</template>

<script>
import User from '../../utils/user'
import Footer from '../components/Footer.vue'
import Header from '../components/Header.vue'
import ServiceTable from '../components/ServiceTable.vue'

export default {
  name: 'Manage',
  components: {
    Header,
    Footer,
    ServiceTable
  },
  data () {
    return {
      userInfo: {},
      levelIcon:'free'
    }
  },
  created () {
    this.userInfo = User.getInfo();
    if(!this.userInfo || !User.getToken()) {
        this.$router.replace('/Login');
        return;
    }
    this.setTitle('会员升级');
    switch(this.userInfo.level){
        case 1:
            this.levelIcon = 'major';
            break;
        case 2:
            this.levelIcon = 'company';
            break;
        case 3:
            this.levelIcon = 'custom';
            break;
        default:
            break;
    }
  },
  methods: {
  }
}
</script>
<style src="@/assets/css/manage.css"  scoped></style>
<style src="@/assets/css/service.css"  scoped></style>
